<template>
	<view class="page-fade-in" :style="{opacity: pageOpc}">
		<template v-if="pageOpc">
			<view class="content">
				<view class="service-box flexWrapNo" @tap="makePhoneCall()">
					<view class="service-img">
						<image src="../static/user/wechat.png"></image>
						<image src="../static/user/service.png"></image>
					</view>
					<view class="service-info">
						<view>门店客服8:00-23:00</view>
						<view class="phone">{{phoneNumber||'未设置'}}</view>
					</view>
				</view>
				<view class="exeplan-box">
					<view class="exeplan-title">常见问题</view>
					<view class="second-title">如何开灯/开台</view>
					<view class="exeplan-cont">
						<view class="exeplan-item">
							<text class="exeplan-num">1</text>
							微信扫桌台二维码,进入微信小程序
						</view>
						<view class="exeplan-item">
							<text class="exeplan-num">2</text>
							填写“姓名”,“手机号”完成注册
						</view>
						<view class="exeplan-item">
							<text class="exeplan-num">3</text>
							指定桌台,可选 <text class="special">立即开台</text><text class="special">预约开台</text><text class="special">套餐</text>
						</view>
						<view class="exeplan-item">
							<text class="exeplan-num">4</text>
							下单并支付后,系统会自动开灯,到时间后自动熄灯
						</view>
						<view class="tips">仅立即开台的订单,中途取消结算,套餐不支持中途退款哦</view>
					</view>
					<view class="second-title">如何使用团购券</view>
					<view class="exeplan-cont">
						<view class="exeplan-item">
							<text class="exeplan-num">1</text>
							微信扫桌台二维码,进入微信小程序
						</view>
						<view class="exeplan-item">
							<text class="exeplan-num">2</text>
							填写“姓名”,“手机号”完成注册
						</view>
						<view class="exeplan-item">
							<text class="exeplan-num">3</text>
							指定桌台,可选 <text class="special">立即开台</text><text class="special">预约开台</text>
						</view>
						<view class="exeplan-item">
							<text class="exeplan-num">4</text>
							下单并支付后,系统会自动开灯,到时间后自动熄灯
						</view>
						<view class="tips">仅立即开台的订单,中途取消结算,套餐不支持中途退款哦</view>
					</view>
				</view>
				<view class="exeplan-box">
					<view class="exeplan-title">全屋智能语音控制</view>
					<view class="second-title">如何播放音乐</view>
					<view class="exeplan-cont">
						<view class="exeplan-item">
							<text class="exeplan-num">1</text>
							呼叫“小爱同学”并说出想听的歌曲
						</view>
						<view class="tips">
							<view>切歌,换歌曲,控制音量,全语音控制</view>
							<view>(注意控制音量,不要扰民哦)</view>
						</view>
						<view class="exeplan-item">
							<text class="exeplan-num">2</text>
							呼叫“小爱同学”并说开启1号空调
						</view>
						<view class="tips">
							<view>开空调,设温度,控制风量,全语音控制</view>
							<view>(注意控制音量,不要扰民哦)</view>
						</view>
					</view>
				</view>
				<view class="flexWrap">
					<view class="tips-box flexWarpCenterColumn">
						<view class="tips-img flexWarpCenterColumn">
							<image src="../static/home/tips-icon.png" class="tips-icon"></image>
							<view class="tips-text">温馨提示</view>
						</view>
						<view class="tips-cont">
							<view>遇到满台,也可以扫码预约</view>
							<view>保存小程序可提前一天预约</view>
						</view>
					</view>
					<view class="tips-box flexWarpCenterColumn">
						<view class="tips-img flexWarpCenterColumn">
							<image src="../static/home/wran-icon.png" class="tips-icon"></image>
							<view class="tips-text">共同监督</view>
						</view>
						<view class="tips-cont">
							<view>拒绝暴力击球,熄灯打球</view>
							<view>舞枪弄棒等不文明行为</view>
						</view>
					</view>
				</view>
			</view>
		</template>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				pageOpc:0,
				phoneNumber:""
			}
		},
		onLoad() {
			this.storeDetails();
		},
		onReady(){
			setTimeout(() => {
				this.pageOpc=1
			}, 100)
		},
		methods: {
			storeDetails(){
				this.$request.post(this.$api.storeDetails, {
					store_id:uni.getStorageSync('store_id'),
					longitude:uni.getStorageSync('longitude')||"106.540541",
					latitude:uni.getStorageSync('latitude')||"29.590991"
				}, {}).then(res => {
					let {
						data = {}
					} = res;
					if (res.code==1) {
						this.phoneNumber=data.customer_service_mobile||""
					}
				})
			},
			// 拨打电话
			makePhoneCall() {
				let that = this
				if(!that.phoneNumber){
					this.$tools.showToast('暂无客服电话')
					return;
				}
				uni.makePhoneCall({
					phoneNumber:that.phoneNumber
				})
			},
		}
	}
</script>

<style lang="scss">
	.content{
		padding: 28upx;
	}
	.service-box{
		margin-top: 24upx;
		background: linear-gradient( 90deg, #3D46C7 0%, #7781FD 100%);
		border-radius: 20rpx;
		padding: 24upx;
		.service-img{
			image{
				width: 96upx;
				height: 96upx;
				&:nth-last-of-type(1){
					margin-left: -30upx;
				}
			}
		}
		.service-info{
			font-family: PingFang SC, PingFang SC;
			font-weight: 400;
			font-size: 26rpx;
			color: #CED1F7;
			margin-left: 12upx;
			.phone{
				font-family: PingFang SC, PingFang SC;
				font-weight: 600;
				font-size: 34rpx;
				color: #fff;
				margin-top: 6upx;
			}
		}
	}
	.exeplan-box{
		background: #232428;
		border-radius: 20rpx;
		margin-top: 24upx;
		padding: 32upx;
		.exeplan-title{
			font-family: PingFang SC, PingFang SC;
			font-weight: 600;
			font-size: 38rpx;
			color: #FFFFFF;
		}
		.second-title{
			font-family: PingFang SC, PingFang SC;
			font-weight: 500;
			font-size: 30rpx;
			color: #FFFFFF;
			margin-top: 36upx;
		}
		.exeplan-cont{
			margin-top: 24upx;
			.exeplan-item{
				font-family: PingFang SC, PingFang SC;
				font-weight: 400;
				font-size: 26rpx;
				color: #919193;
				margin-top: 15upx;
				.exeplan-num{
					width: 48rpx;
					height: 48rpx;
					border: 1rpx solid #707070;
					font-family: PingFang SC, PingFang SC;
					font-weight: 500;
					font-size: 26rpx;
					color: #FFFFFF;
					line-height: 48rpx;
					display: inline-block;
					text-align: center;
					border-radius: 50%;
					margin-right: 12upx;
				}
				.special{
					font-family: PingFang SC, PingFang SC;
					font-weight: 400;
					font-size: 26rpx;
					color: #FFFFFF;
					margin-left: 22upx;
					position: relative;
					z-index: 9;
					&::after{
						content: '';
						display: inline-block;
						width: -webkit-fill-available;
						height: 10upx;
						position: absolute;
						background-color: #5BBB31;
						bottom: 0;
						left: 0;
						z-index: -1;
					}
				}
			}
			.tips{
				font-family: PingFang SC, PingFang SC;
				font-weight: 400;
				font-size: 24rpx;
				color: #F46E32;
				margin-top: 15upx;
			}
		}
	}
	.tips-box{
		width: 288rpx;
		height: 220rpx;
		background: #64C342;
		border-radius: 20rpx;
		padding: 22upx 26upx;
		margin-top: 24upx;
		&:nth-last-of-type(1){
			background-color:#FF8A57;
		}
		.tips-img{
			position: relative;
			.tips-icon{
				width: 120upx;
				height: 120upx;
			}
			.tips-text{
				font-family: PingFang SC, PingFang SC;
				font-weight: 600;
				font-size: 34rpx;
				color: #FFFFFF;
				position: absolute;
				bottom: 0;
				width: max-content;
			}
		}
		.tips-cont{
			font-family: PingFang SC, PingFang SC;
			font-weight: 400;
			font-size: 24rpx;
			color: rgba(255, 255, 255, .6);
			margin-top: 10upx;
			line-height: 40upx;
		}
	}
</style>
